#include "Background.h"

CBackground::CBackground()
{
	mObjectClassification = ObjectClassification_None;
	this->autorelease();
}
CBackground::~CBackground()
{

}

void CBackground::Load(CCDictionary* dir)
{
	CCSize winSize = CCDirector::sharedDirector()->getWinSize();
	CCString* texPath = dynamic_cast<CCString*>(dir->objectForKey("path"));
	CCString* sizeStr = dynamic_cast<CCString*>(dir->objectForKey("size"));
	CCPoint size = CCPointFromString(sizeStr->getCString());
	CCRect rect = CCRectMake(0,0,size.x,size.y);
	CCScale9Sprite* backGround = CCScale9Sprite::create(texPath->getCString(),rect,rect);
	backGround->setContentSize(winSize);
	backGround->setPosition(ccp(winSize.width/2,winSize.height/2));
	this->addChild(backGround);
}